UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'x7pFGdQIVc/5EK6J41RVbqXF7UMLAprK5i4cmeRxj2M=' 
WHERE 
  key_id = '9c97e4aec31107403ee4ed252045e7410ee36b4cd9a0aa23402e76327f1e39d5' 
  AND (
    token = 'x7pFGdQIVc/5EK6J41RVbqXF7UMLAprK5i4cmeRxj2M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033