UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0dL3HTSmACsapF9VaOTjYYfRVplaBRcoGMMHpyLw8j4='
WHERE
key_id = 'afad2e5e1d2726ddee0a958bd44fb45f36225e40b1be28534c0cf7944d9463e3'
AND (
token = '0dL3HTSmACsapF9VaOTjYYfRVplaBRcoGMMHpyLw8j4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)