UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9ERYdLctT2Uh/uBybFaA9uGB1UXzwp5TiGh6YORt+sI='
WHERE
key_id = 'd70589bc0961f8ea4ab52040764d55155ede93130c67beaa752fe75e241fb0c7'
AND (
token = '9ERYdLctT2Uh/uBybFaA9uGB1UXzwp5TiGh6YORt+sI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)