UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZOQBwGT6md1V0gmfZNC+0X33Ce36AsA257tx5i0uODQ='
WHERE
key_id = '16616fc5f1ba8f5a65255da861fd0d4a559eb945a321a78c42d5e782c5c3c425'
AND (
token = 'ZOQBwGT6md1V0gmfZNC+0X33Ce36AsA257tx5i0uODQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)