UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CPyxbsDV9/AlMsnKc6YjfIpFwkRYYlNaEWknjhLX/i4='
WHERE
key_id = '1dc10d836cd8932a9490b32a7f20ae7d58cfa373da009748e9c061fb691cd88b'
AND (
token = 'CPyxbsDV9/AlMsnKc6YjfIpFwkRYYlNaEWknjhLX/i4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)