UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'N7Gnhjtx1o6TaC5fmWOphDODNsxu78/iY69fMeTPoj0='
WHERE
key_id = '75ad51be5391f77d27628552ca1faa3126b74930d0dfb7714e6946dd3af6b98f'
AND (
token = 'N7Gnhjtx1o6TaC5fmWOphDODNsxu78/iY69fMeTPoj0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)