UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'P8LZ/d3h2f89rRvKnU5zpBKPw3CmwDOR+Pu7MoW+Qyc='
WHERE
key_id = '5bbca77fbaa954c5305b71d59557a568cc1fa7f1ae53f1436bfab64a555cc0ab'
AND (
token = 'P8LZ/d3h2f89rRvKnU5zpBKPw3CmwDOR+Pu7MoW+Qyc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)