UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mVOZ/U8As8gSM/R+thpMWll//hseiGeo49Kz5PlOo6c=' 
WHERE 
  key_id = '888570e69d639f508b9b10366669b148e359120f46c749874e13443d094cdddd' 
  AND (
    token = 'mVOZ/U8As8gSM/R+thpMWll//hseiGeo49Kz5PlOo6c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036