UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'L0+yoYSjUZselSGk3NPqhDY9C5slyljHMKt6PXDROzY=' 
WHERE 
  key_id = '19464d5d898d485a6ab97743b57f450e8cc6d5b85414cf4033a5bbbde1625b2b' 
  AND (
    token = 'L0+yoYSjUZselSGk3NPqhDY9C5slyljHMKt6PXDROzY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042