UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'fyY4vc7ARkAuIXWtYA5A4X3307lT7JvKVIPmEMsnpKc=' 
WHERE 
  key_id = '81f7f480f3f81fce0e4fe951b5a1df2bdf12ab5cce7f472fd5d78e843c97113e' 
  AND (
    token = 'fyY4vc7ARkAuIXWtYA5A4X3307lT7JvKVIPmEMsnpKc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021