UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'U38E7spOH4+bCIoIPO64ApFIdvbu0jU3oUA0veoz6ZE=' 
WHERE 
  key_id = '06e29767e87b329afad5c58bf9dd77145b5bc6e9d4224f2b9c1fca54b2b81e3c' 
  AND (
    token = 'U38E7spOH4+bCIoIPO64ApFIdvbu0jU3oUA0veoz6ZE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028