UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'e0xNOgC9d1ag2j4h/a6oXElgB/ZEzeXFQA3rHfmaiqU=' 
WHERE 
  key_id = 'ab56ff565fe5b5f62c73214a81531c9cd39e5617907c32db9f90848c2f9af806' 
  AND (
    token = 'e0xNOgC9d1ag2j4h/a6oXElgB/ZEzeXFQA3rHfmaiqU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028