UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'XuIsMYS+yeluh1MMtd1VAMHAnalKQqgW6EYEZgMp1Cs='
WHERE
key_id = '46cd780db89657622439c0492ccb929f21ca04e6080a269571336c6ae6088afa'
AND (
token = 'XuIsMYS+yeluh1MMtd1VAMHAnalKQqgW6EYEZgMp1Cs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)