UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2yZxrsELZdJUf6u5KVbuXIhY2ogo77OIPb40KNKI3Is='
WHERE
key_id = '39bd181ebb1bcc86ac77f6e78928e076b58648c666c3f7429774536f5b548618'
AND (
token = '2yZxrsELZdJUf6u5KVbuXIhY2ogo77OIPb40KNKI3Is='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)