UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JTPLBakq8ogbAN4b1BY2Y0kupv1UXmUwThaqJgcJ74g='
WHERE
key_id = 'f98fc2be40d9931d9127d47b81073a3f57ce68252c87de55a880c1dfa3ae454c'
AND (
token = 'JTPLBakq8ogbAN4b1BY2Y0kupv1UXmUwThaqJgcJ74g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)