UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'iBIDVyDDkdhJZLg3pS7Lxn3CGTj9KRS0pBnN3bLX5LA=' 
WHERE 
  key_id = '1508f5daf526dc4c596afcf1bb14e7c0883c828e3b7a5278ca64226757499158' 
  AND (
    token = 'iBIDVyDDkdhJZLg3pS7Lxn3CGTj9KRS0pBnN3bLX5LA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017