UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xFQHQp61smd+K9JBAdJcdJQO0OynyZfVOZ4ILapUfCs='
WHERE
key_id = 'd0e8b002175d163a29f159cc89125e8d83d7b1e70fdff0f9f1ae19b3bce46d06'
AND (
token = 'xFQHQp61smd+K9JBAdJcdJQO0OynyZfVOZ4ILapUfCs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)