UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wxAvlxL7/iY75tzmbPbs2CI3DD5cUpdHpCOWEIA4LBw=' 
WHERE 
  key_id = '1476bf56c69fc601232c2edecac2cf9f981ce8e630e43c14e4cfdf9f258b15bd' 
  AND (
    token = 'wxAvlxL7/iY75tzmbPbs2CI3DD5cUpdHpCOWEIA4LBw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00051