UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'pkDJq8FY20WuSClw3LtbHMfAcCt2s8QS06+5y9FIquc=' 
WHERE 
  key_id = 'a42920f8cdfe026aaedf20ec0d0d05a5b93062ac6e7e2f0c78c40e751d9c0054' 
  AND (
    token = 'pkDJq8FY20WuSClw3LtbHMfAcCt2s8QS06+5y9FIquc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044