UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lBso90vtAIiJvtrWpZXthYSqfNp6aEZRTelc20X2XRE=' 
WHERE 
  key_id = 'cfb2b85532752b7c0ef956e41f53ade1cd4f0de9efc645ae167ee5d300db8d93' 
  AND (
    token = 'lBso90vtAIiJvtrWpZXthYSqfNp6aEZRTelc20X2XRE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042