UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'gzNIFU5EqOhHT4EXHiws7Eatl/R/kc0F0Cgx3BiQBNI=' 
WHERE 
  key_id = 'cfeea7528e94427575a5dee1f05147c8ebb209f9d9c7f44121ad6ac9718153d5' 
  AND (
    token = 'gzNIFU5EqOhHT4EXHiws7Eatl/R/kc0F0Cgx3BiQBNI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021