UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'fQFsb39/YvQte6dVntD590WTpduGoiVYxVbxSgOqiCA=' 
WHERE 
  key_id = 'e8aeacbf4d607bf8e07a60cc17371c0625abf1712d10c3cc4324d906654e2228' 
  AND (
    token = 'fQFsb39/YvQte6dVntD590WTpduGoiVYxVbxSgOqiCA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016