UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EV4rrF7N0/5LqzwlH8lHyQgQU+GellYKKi1kw7IjMBs=' 
WHERE 
  key_id = '1e00d6c0a8de9f3be170d4bfeee1484c10bdbda107966fd6b42e9c521c0264b9' 
  AND (
    token = 'EV4rrF7N0/5LqzwlH8lHyQgQU+GellYKKi1kw7IjMBs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030