UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ednBB2jawMFFUPgw/w14THJv4GY0P/Hx57fbh0Uzc8c=' 
WHERE 
  key_id = 'c7d8ff8bba16638907690ce85327149aa0c0df44e32181ba92966da8bacb585f' 
  AND (
    token = 'ednBB2jawMFFUPgw/w14THJv4GY0P/Hx57fbh0Uzc8c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044