UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Na1iWeLWQ+qR/OWXC7dZD1JV6XRY2Sv86IB2/eUxtVQ='
WHERE
key_id = '0f6c9cd9870155c4a13e5dc8eded791e15a82c3c4fc774752f28479b60c30f62'
AND (
token = 'Na1iWeLWQ+qR/OWXC7dZD1JV6XRY2Sv86IB2/eUxtVQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)