UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '23LHbvTseMrCuRDmKpTOqMu+Bb+mGi06JvxEeAMSxHc='
WHERE
key_id = 'e71dfc019a640c7ed9189a120aad5fd0eafc74ed7c86b0b308f0f4171e9b1032'
AND (
token = '23LHbvTseMrCuRDmKpTOqMu+Bb+mGi06JvxEeAMSxHc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)