UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vdBX8D7J64k1pFS+bHrWrgZucnfL/npMWMkUAUXXx/4='
WHERE
key_id = '76b2006e2fb9e82b63326c5a890116e26456eda5f5d49bd7b5f801f239df4353'
AND (
token = 'vdBX8D7J64k1pFS+bHrWrgZucnfL/npMWMkUAUXXx/4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)