UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xPENv90x0OeSs1cnkY/1uvjBr8JX0+hhR3emyX8AU+0='
WHERE
key_id = '828c12f11dc66a039cd0d7cc5e202ec755f663a00abd77a3621cf662b366bb58'
AND (
token = 'xPENv90x0OeSs1cnkY/1uvjBr8JX0+hhR3emyX8AU+0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)