UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WZjH/RksENkTn9311KZxT8tnbGXvOB17E7qPHtWzLb0='
WHERE
key_id = '7d5ba47c7a81c207089cf93914b4303d20a6bcf86d0d3b554c2f082fc84166c6'
AND (
token = 'WZjH/RksENkTn9311KZxT8tnbGXvOB17E7qPHtWzLb0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)