UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'AhxleD7ogRxVrCBwy4IAV1se4KlGC15Haia+VvrU1FE=' 
WHERE 
  key_id = '182f0eb02be870a8c0829fa9023279e64dea47900efea7f241c46fb7bbb9a7cb' 
  AND (
    token = 'AhxleD7ogRxVrCBwy4IAV1se4KlGC15Haia+VvrU1FE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021