UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jWpTEHntm40/qrx5EQ/Q8zY+Put+9fYlHwodjFF7+Uo='
WHERE
key_id = '785f527397141efae782861190b07b79f2618c7b8b94b689cd5942f83b4add28'
AND (
token = 'jWpTEHntm40/qrx5EQ/Q8zY+Put+9fYlHwodjFF7+Uo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)