UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '19hXO7TqFBht7HE/dKlVvQujjyjQfZ/r1NhdqxF9cJw=' 
WHERE 
  key_id = '351926422997e5bb8af38d32a01df282a8c28764de95242e1e272647706bf40f' 
  AND (
    token = '19hXO7TqFBht7HE/dKlVvQujjyjQfZ/r1NhdqxF9cJw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026