UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vIouFanWyaHDQb/l5uI/tocQZyB96B7q5sgn3kmlZ1w=' 
WHERE 
  key_id = '690baed3ad8060a4489dfd61ad52c5090c47d168c99fa5cbe48f4e58ab3804af' 
  AND (
    token = 'vIouFanWyaHDQb/l5uI/tocQZyB96B7q5sgn3kmlZ1w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035