UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'XKXJL8Ow7wgU9LQYvU+QTK66ZD3WrDG4/SmkdcLh1i8='
WHERE
key_id = '22631170f47e9f99e2fa366a0796ac9a750d66d6f75ecec1b409d54e517d9b3d'
AND (
token = 'XKXJL8Ow7wgU9LQYvU+QTK66ZD3WrDG4/SmkdcLh1i8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)