UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sz7xe9FsMuy3hd2QeddFNxrqE6NE5YegPBEUjgaG6T0='
WHERE
key_id = '12efb5de909afefb3ab9ed361ca3928f64693e01e0014b926af59768fcc3cbd5'
AND (
token = 'sz7xe9FsMuy3hd2QeddFNxrqE6NE5YegPBEUjgaG6T0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)