UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yCGj2uIRUmioowP7NSpQyxFCIeGOA2q9RDI2bWdyufo=' 
WHERE 
  key_id = '29f3c2524c118d0117537c8736601cbc68e4008a6c2066ee61ad365d2c97087a' 
  AND (
    token = 'yCGj2uIRUmioowP7NSpQyxFCIeGOA2q9RDI2bWdyufo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021