UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ali4G6+c9aXSRh79dDCIFIO41veEy5V1lXeAFSk3qK8='
WHERE
key_id = '36b2b74b816f41424de2d1abaa77986825d4039d60dbf26b4086220cfefb18fb'
AND (
token = 'ali4G6+c9aXSRh79dDCIFIO41veEy5V1lXeAFSk3qK8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)