UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'iAIIlTPSrMT+6GGFwUJNerLjGJ0I8n1ucuVmOOTSH3Q=' 
WHERE 
  key_id = 'aac65ca347310306a2c5465dfd19f1eb18566d26c4dbefac76b462fd74a3cbfe' 
  AND (
    token = 'iAIIlTPSrMT+6GGFwUJNerLjGJ0I8n1ucuVmOOTSH3Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049