UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2dI1IN5fgKO2QAp9gSPoNPj8/sKl0NMWkUonmLreZ18=' 
WHERE 
  key_id = 'd38a06407d386a828a44dbfb1ded8e70fbcac8fd3a4af78ab6f8e50d1cbecbe9' 
  AND (
    token = '2dI1IN5fgKO2QAp9gSPoNPj8/sKl0NMWkUonmLreZ18=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027