UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'YoujJqhj/QMzs8PfRUP2kTZgiuFXsEDzqUwbHqJJlkg=' 
WHERE 
  key_id = 'b548caba62d1ccaa21c67746aa5d933a61916897bbbf152da58e11cd34ce13d2' 
  AND (
    token = 'YoujJqhj/QMzs8PfRUP2kTZgiuFXsEDzqUwbHqJJlkg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037