UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'CQCnNufsx3DzQ+l/ibuRyZQds/+qs3gv8lQdGpaqZWs=' 
WHERE 
  key_id = '75437cd99e6702cf957b916361c3cc5a6c6c77eccf5bb1127bf53719f2b8444a' 
  AND (
    token = 'CQCnNufsx3DzQ+l/ibuRyZQds/+qs3gv8lQdGpaqZWs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027