UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lfg5AL/DJ36qwhlh/YyPjav9XPQI1KSCVfjqIFfX27E='
WHERE
key_id = '59546b48400590f227efeacf36f7d3c4c740516b2c94e1b86ffa23b1957bb9fd'
AND (
token = 'lfg5AL/DJ36qwhlh/YyPjav9XPQI1KSCVfjqIFfX27E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)