UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'K4NbdKD+4T3ezmSNjPwNYGjTckZVjeSw3a/M3lIqd7c=' 
WHERE 
  key_id = 'f126a50a1299aeee9a4ef791bda739269269f6cfd01abcca3e5b6d5f42a38c01' 
  AND (
    token = 'K4NbdKD+4T3ezmSNjPwNYGjTckZVjeSw3a/M3lIqd7c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022