UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jtosOrhxcUtxtED2+/VfoTW2+KKrDtmZ9aZG997EnOg='
WHERE
key_id = '654bccdf6e9918e0cf281771b645f12c801b45a9736a734cebba32c4386db5de'
AND (
token = 'jtosOrhxcUtxtED2+/VfoTW2+KKrDtmZ9aZG997EnOg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)