UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 't4HSnqNj5h/qVfI+qLS0VDD9PAvxYQOVYprt0uY4cFI=' 
WHERE 
  key_id = 'af9cb3dfb663060e54b75f2ab076f6a925fb4ca7241b28cc322d6d8064fc9f19' 
  AND (
    token = 't4HSnqNj5h/qVfI+qLS0VDD9PAvxYQOVYprt0uY4cFI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022