UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UQizquEUhD6vk5wCiRVuP5d7UakgWMbQjnF47bqQTow='
WHERE
key_id = '6ed0c78cdef357cdcd51ebfba741e2a314bf569816d388f53813daf078f10091'
AND (
token = 'UQizquEUhD6vk5wCiRVuP5d7UakgWMbQjnF47bqQTow='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)