UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6ZuoW80n2ynL13gDY20ZYDnoLo4GU+Gt2IhyWd1xi0s=' 
WHERE 
  key_id = 'd7dc3c6fd120ae5a0cca267dd64e9aac4f11ca437183bcf739c6b5318c675373' 
  AND (
    token = '6ZuoW80n2ynL13gDY20ZYDnoLo4GU+Gt2IhyWd1xi0s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034