UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nUXoJzb/BjTNZjPziBTS9h6Qzb7AZogiSswWwnn4pYU='
WHERE
key_id = '67e87fe02be1a3feff0f8bad1ff0b9612f4e31d57a74e73a434ee3ea24d125ab'
AND (
token = 'nUXoJzb/BjTNZjPziBTS9h6Qzb7AZogiSswWwnn4pYU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)