UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/f3f9nB2n9s/5fGL7flebsLVktM8IsPLgAKe62XnswI=' 
WHERE 
  key_id = '8038915c6cd5b5ee2650411ec2907715d47ac55486fd5055e95002ea55abfaac' 
  AND (
    token = '/f3f9nB2n9s/5fGL7flebsLVktM8IsPLgAKe62XnswI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036