UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9innckibEtxP2i0HG2qtj/GllnBOToi3tWPwIbqPMZM=' 
WHERE 
  key_id = '97950c4a3469a9762f7e0bfa0f3e42f117a29e3c5dbccd9b82cfb84e08956537' 
  AND (
    token = '9innckibEtxP2i0HG2qtj/GllnBOToi3tWPwIbqPMZM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032