UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zGU5NsddX8P2p9JL+xyCS0vHa6ge80OcwkVTQIPxX/M=' 
WHERE 
  key_id = '15b54905595425f30e6060b7b265dc7ce808505d3c3624ba2e608aec6a1dc28b' 
  AND (
    token = 'zGU5NsddX8P2p9JL+xyCS0vHa6ge80OcwkVTQIPxX/M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031