UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'SpnCRoAajkwsK8A6nFNb8/aRU/Ffg5H45YYUbogoIaQ=' 
WHERE 
  key_id = '09ba6f3e51473856614f54283e003eb720ff818cd8eca9c0125a6019cb86cdb9' 
  AND (
    token = 'SpnCRoAajkwsK8A6nFNb8/aRU/Ffg5H45YYUbogoIaQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036