UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YdzG0OmH5aIE4BjvZ5GMmFI/zi/5GPLNwGHSNZnNCWo='
WHERE
key_id = '3a1f5dd0feaf6ae9efc4e7182fbed88f44c4e718fe51fca32233150bb78ab015'
AND (
token = 'YdzG0OmH5aIE4BjvZ5GMmFI/zi/5GPLNwGHSNZnNCWo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)