UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'AIIXzjdrBovAy5qhbbPshhTDzF9huW04VN65VpmmCAc='
WHERE
key_id = 'd529bad0a6563b53709cb97d8e1d6e4ce79ee797ff579ce1124d9d9c90aa9402'
AND (
token = 'AIIXzjdrBovAy5qhbbPshhTDzF9huW04VN65VpmmCAc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)