UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8EzgUOR265KgZbn/M4MOFnse/vbLx7jWk1ZDpiihNYg=' 
WHERE 
  key_id = 'b15e68cc011cd221ec50d487378915aeadc979a7f7fde8b4de72548e278c99f4' 
  AND (
    token = '8EzgUOR265KgZbn/M4MOFnse/vbLx7jWk1ZDpiihNYg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016