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