UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WvjpBo7mTgFiEAzC6hQiWNuLY8VQ/CC09rJVurWX4L8='
WHERE
key_id = 'ded7bb757a1ed61e070fe1735fbc8e8f50e8471513f3c70b5b02d8181509d006'
AND (
token = 'WvjpBo7mTgFiEAzC6hQiWNuLY8VQ/CC09rJVurWX4L8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)