UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'b1Xo0JpgQNuxM4A53oLbPIyrZOp1ghVnzbFvul8aGuM='
WHERE
key_id = 'cf471c984f320a26f8fd3a938ad2c6ab3aa1661ecc6e8b194080187a6bf2f01f'
AND (
token = 'b1Xo0JpgQNuxM4A53oLbPIyrZOp1ghVnzbFvul8aGuM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)